﻿using System;
using System.Collections.Generic;
using System.ServiceModel;

using DistributedServices.Core.ErrorHandlers;
using DistributedServices.MainModule.DTO;
using Domain.MainModule.Entities;

namespace DistributedServices.MainModule
{
    /// <summary>
    /// Contract for MainModule distributed service
    /// </summary>
    /// <remarks>
    /// Creado por: Mauro Zuccolo
    /// Fecha creacion: 15/10/2010
    /// Modificado por: Sebastian Lazarte   
    /// Fecha modificacion: 22/11/2010
    /// </remarks>
    [ServiceContract(Name = "IMainModuleService",
        Namespace = "DistributedServices.MainModuleService",
        SessionMode = SessionMode.NotAllowed)]
    public interface IMainModuleService
    {

        #region Customer

        Customer GetCustomerByUserId(Guid userId);
        void ChangeCustomer(Customer customer);
        void RemoveCustomer(Customer customer);
        void AddCustomer(Customer customer);
        List<Customer> GetPagedCustomer(PagedCriteria pagedCriteria);

        #endregion

        #region Employee

        Employee GetEmployeeByUserId(Guid userId);
        void ChangeEmployee(Employee employee);
        void RemoveEmployee(Employee employee);
        void AddEmployee(Employee employee);
        List<Employee> GetPagedEmployee(PagedCriteria pagedCriteria);

        #endregion

        #region CustomerMTS

        CustomerMTS GetCustomerMTSByUserId(string firstName, string lastName, string firstSurname, string lastSurname);
        void ChangeCustomerMTS(CustomerMTS customer);
        void RemoveCustomerMTS(CustomerMTS customer);
        void AddCustomerMTS(CustomerMTS customer);
        List<CustomerMTS> GetPagedCustomerMTS(PagedCriteria pagedCriteria);

        #endregion

        #region CustomerCompany

        CustomerCompany GetCustomerCompanyByUserId(Guid userId);
        void ChangeCustomerCompany(CustomerCompany customerCompany);
        void RemoveCustomerCompany(CustomerCompany customerCompany);
        void AddCustomerCompany(CustomerCompany customerCompany);
        List<CustomerCompany> GetPagedCustomerCompany(PagedCriteria pagedCriteria);

        #endregion

        #region Address

        List<Address> GetAddressByUserId(Guid userId);
        void ChangeAddress(Address address);
        void RemoveAddress(Address address);
        void AddAddress(Address address);
        Address GetAddressById(Guid addressId);

        #endregion

        #region Phone

        List<Phone> GetPhoneByUserId(Guid userId);
        Phone GetPhoneById(Guid phoneId);
        void ChangePhone(Phone phone);
        void RemovePhone(Phone phone);
        void AddPhone(Phone phone);

        #endregion

        #region GroupBranch

        GroupBranch GetGroupBranchByGroupBrachId(Guid groupBranchId);
        void ChangeGroupBranch(GroupBranch groupBranch);
        void RemoveGroupBranch(GroupBranch groupBranch);
        void AddGroupBranch(GroupBranch groupBranch);
        List<GroupBranch> GetPagedGroupBranch(PagedCriteria pagedCriteria);

        Branch GetBranchByBranchId(Guid branchId);
        List<Branch> GetBranchsByGroupBranchId(Guid groupBranchId);

        BillingInformation GetBillingInformationByBillingInformationId(Guid billingInformation);
        List<BillingInformation> GetBillingInformationsByGroupBranchId(Guid groupBranchId);
        List<BillingInformation> GetBillingInformationsByName(string name);
        List<BillingInformation> GetBillingInformationsByCUIT(string cuit);

        #endregion

        #region Identities

        List<Identity> GetIdentityByUserId(Guid userId);
        Identity GetIdentityById(Guid identityId);
        void ChangeIdentity(Identity identity);
        void RemoveIdentity(Identity identity);
        void AddIdentity(Identity identity);

        #endregion

        #region Ordes

        Order GetOrderByOrderId(Guid orderId);
        Order GetOrderById(Guid orderId);
        void ChangeOrder(Order order);
        void RemoveOrder(Order order);
        void AddOrder(Order order);

        #endregion

        #region Soundex Code

        /// <summary>
        /// Add new soundexCode
        /// </summary>
        /// <param name="soundexCode">SoundexCode to be added</param>
        void AddSoundexCode(SoundexCode soundexCode);

        /// <summary>
        /// Change existing soundexCode
        /// </summary>
        /// <param name="soundexCode">Existing soundexCode to modify</param>
        void ChangeSoundexCode(SoundexCode soundexCode);

        /// <summary>
        /// Remove existing soundexCode
        /// </summary>
        /// <param name="soundexCode">SoundexCode to remove</param>
        void RemoveSoundexCode(SoundexCode soundexCode);

        /// <summary>
        /// Find an soundexCode using userId
        /// </summary>
        /// <param name="userId">userId</param>
        /// <returns>A list of soundex codes</returns>
        List<SoundexCode> FindSoundexCodeByUserId(Guid userId);

        /// <summary>
        /// Find the soundex codes using the value
        /// </summary>
        /// <param name="value">value ti find</param>
        /// <returns>a list of soundex codes</returns>
        List<SoundexCode> FindSoundexCodeByValue(string value);


        #endregion
    }
}
